import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class NavBar extends Component {
  static propTypes = {
    title: PropTypes.string
  }
  static defaultProps = {
    title: 'zhangsan'
  }
  say() { 
    console.log(this);
    this.setState((a, b) => {
      console.log('13', a, b);
      return {}
    })
  }
  render() {
    console.log(this);
    const { changeTitle, films } = this.props
    return (
      <div>
         <ul>
        {
            
            films.map(item => { 
              return <li key={ item.filmId }>{ item.name }</li>
            })
          }
        </ul>
        <div>{this.props.title}</div>
        <button onClick={ changeTitle }>lisi</button>
      </div>
    )
  }
}
